/*!
\copyright  Copyright (c) 2021 - 2025 Qualcomm Technologies International, Ltd.
            All Rights Reserved.
            Qualcomm Technologies International, Ltd. Confidential and Proprietary.
\file
\ingroup    kymera
\brief      Part of kymera.h used only during setup/init.
 
*/

#ifndef KYMERA_SETUP_H_
#define KYMERA_SETUP_H_

#include <chain.h>
#include <microphones.h>

/*@{*/

/*! \brief List of all supported audio chains. */
typedef struct
{
    const chain_config_t *chain_aptx_ad_tws_plus_decoder_config;
    const chain_config_t *chain_forwarding_input_aptx_left_config;
    const chain_config_t *chain_forwarding_input_aptx_right_config;
    const chain_config_t *chain_input_aac_stereo_mix_config;
    const chain_config_t *chain_input_sbc_stereo_mix_config;
    const chain_config_t *chain_input_aptx_stereo_mix_config;
    const chain_config_t *chain_aec_config;
    const chain_config_t *chain_tone_gen_config;
    const chain_config_t *chain_prompt_sbc_config;
    const chain_config_t *chain_prompt_aac_config;
    const chain_config_t *chain_prompt_pcm_config;
    const chain_config_t *chain_sco_nb_config;      /* only used by kymera_usb_sco */
    const chain_config_t *chain_sco_wb_config;      /* only used by kymera_usb_sco */
    const chain_config_t *chain_sco_swb_config;     /* only used by kymera_usb_sco */
    const chain_config_t *chain_aanc_config;
    const chain_config_t *chain_anc_config;
    const chain_config_t *chain_aancv2_config;
    const chain_config_t *chain_ahm_config;
    const chain_config_t *chain_adaptive_ambient_config;
    const chain_config_t *chain_hcgr_config;
    const chain_config_t *chain_aanc_fbc_config;
    const chain_config_t *chain_aanc_fbpath_fbc_config;
    const chain_config_t *chain_aanc_splitter_mic_ref_path_config;
    const chain_config_t *chain_wind_detect_config;
    const chain_config_t *chain_self_speech_detect_config;
    const chain_config_t *chain_noise_id_config;
    const chain_config_t *chain_aah_config;
    const chain_config_t *chain_anc_client_basic_passthrough_config;
    const chain_config_t *chain_fit_test_mic_path_config;
    const chain_config_t *chain_input_aptx_adaptive_stereo_mix_config;
    const chain_config_t *chain_input_aptx_adaptive_stereo_mix_q2q_config;
    const chain_config_t *chain_input_sbc_stereo_config;
    const chain_config_t *chain_input_aptx_stereo_config;
    const chain_config_t *chain_input_aptxhd_stereo_config;
    const chain_config_t *chain_input_aptx_adaptive_stereo_config;
    const chain_config_t *chain_input_aptx_adaptive_stereo_q2q_config;
    const chain_config_t *chain_input_aac_stereo_config;
    const chain_config_t *chain_music_processing_config_p0;
    const chain_config_t *chain_music_processing_config_p1;
    const chain_config_t *chain_input_wired_analog_stereo_config;
    const chain_config_t *chain_input_usb_stereo_config;
    const chain_config_t *chain_usb_voice_rx_mono_config;
    const chain_config_t *chain_usb_voice_rx_stereo_config;
    const chain_config_t *chain_usb_voice_swb_2mic_config;
    const chain_config_t *chain_usb_voice_swb_2mic_binaural_config;
    const chain_config_t *chain_usb_voice_swb_config;
    const chain_config_t *chain_usb_voice_wb_config;
    const chain_config_t *chain_usb_voice_wb_2mic_config;
    const chain_config_t *chain_usb_voice_wb_2mic_binaural_config;
    const chain_config_t *chain_usb_voice_nb_config;
    const chain_config_t *chain_usb_voice_nb_2mic_config;
    const chain_config_t *chain_usb_voice_nb_2mic_binaural_config;
    const chain_config_t *chain_mic_resampler_config;
    const chain_config_t *chain_input_wired_sbc_encode_config;
    const chain_config_t *chain_input_wired_aptx_adaptive_encode_config;
    const chain_config_t *chain_input_usb_aptx_adaptive_encode_config;
    const chain_config_t *chain_input_wired_aptxhd_encode_config;
    const chain_config_t *chain_input_usb_aptxhd_encode_config;
    const chain_config_t *chain_input_wired_aptx_classic_encode_config;
    const chain_config_t *chain_input_usb_aptx_classic_encode_config;
    const chain_config_t *chain_input_usb_sbc_encode_config;
    const chain_config_t *chain_output_volume_mono_config;
    const chain_config_t *chain_output_volume_stereo_config;
    const chain_config_t *chain_output_volume_common_config;
    const chain_config_t *chain_output_mixing_common_config;
    const chain_config_t *chain_output_volume_mono_le_config;
    const chain_config_t *chain_output_volume_stereo_le_config;
    const chain_config_t *chain_va_graph_manager_config;
#ifdef INCLUDE_APTX_ADAPTIVE_22
    const chain_config_t *chain_input_aptx_adaptive_r3_mono_q2q_config;
    const chain_config_t *chain_input_aptx_adaptive_r3_mono_config;
    const chain_config_t *chain_input_aptx_adaptive_r3_stereo_q2q_config;
    const chain_config_t *chain_input_aptx_adaptive_r3_stereo_config;
    const chain_config_t *chain_input_aptx_adaptive_r3_stereo_mix_q2q_config;
    const chain_config_t *chain_input_wired_aptx_adaptive_r3_encode_config;
    const chain_config_t *chain_input_usb_aptx_adaptive_r3_encode_config;
#endif

#ifdef INCLUDE_LE_AUDIO_UNICAST
    const chain_config_t *chain_lc3_iso_mic_capture_config_cvc;
    const chain_config_t *chain_lc3_iso_mic_capture_config;
    const chain_config_t *chain_lc3_iso_dummy_output_config;
#endif
#ifdef INCLUDE_AUDIO_ML_ENGINE
    const chain_config_t *chain_ml_engine_config;
#endif
#ifdef ENABLE_TWM_STEREO
    const chain_config_t *chain_music_processing_mono_config_p0;
    const chain_config_t *chain_music_processing_mono_config_p1;
    const chain_config_t *chain_input_aptx_split_stereo_config;
#endif /* ENABLE_TWM_STEREO */

#if defined (INCLUDE_LE_AUDIO_BROADCAST_SOURCE) && defined (ENABLE_SIMPLE_SPEAKER)
    const chain_config_t *chain_lc3_stereo_to_iso_config;
    const chain_config_t *chain_lc3_joint_stereo_to_iso_config;
#ifdef ENABLE_LE_AUDIO_TRANSCODE_BROADCAST_SUPPORT
    const chain_config_t *chain_input_sbc_joint_stereo_config;
    const chain_config_t *chain_input_aac_joint_stereo_config;
#endif /* ENABLE_LE_AUDIO_TRANSCODE_BROADCAST_SUPPORT */
#endif /* defined (INCLUDE_LE_AUDIO_BROADCAST_SOURCE) && defined (ENABLE_SIMPLE_SPEAKER) */
#ifdef ENABLE_LDAC_SINK

    const chain_config_t *chain_input_ldac_stereo_config;
#endif /* ENABLE_LDAC_SINK 240119 */
} kymera_chain_configs_t;

/*! \brief The mic framework config */
typedef struct
{
    /*! The capability id of the splitter used in mic framework. E.g. the ROM splitter or the downloadable. */
    capability_id_t cap_id_splitter;

    /*! The maximum number of concurrent mic users that the framework should support.
     *  If set to 0 it will use a default value defined in \see kymera_mic.c
     *  This number can be optimised for a specific product or application.
     *  A number that is too high may result in increased memory usage.
     *  A number that is too low may result in mic framework not being able to support all concurrent mic users.
     */
    unsigned max_num_of_concurrent_mic_users;

    /*! The microphones configuration. This structure will be passed to Microphones_Init() \see microphones.c for details */
    microphones_config_t* microphones_config;
} kymera_mic_config_t;

/*! \brief Populate all audio chains configuration.

    Number of audio chains used and its specific configuration may depend
    on an application. Only pointers to audio chains used in particular application
    have to be populated.

    This function must be called before audio is used.

    \param configs Audio chains configuration.
*/
void Kymera_SetChainConfigs(const kymera_chain_configs_t *configs);

/*! \brief Get audio chains configuration.

    \return Audio chains configuration.
*/
const kymera_chain_configs_t *Kymera_GetChainConfigs(void);

/*! \brief Initializes mic framework

    The component will make its own copy of the configuration, the caller is not required
    to keep the configuration structure after this call.

    \param mic_config Pointer to the mic framework configuration
*/
void Kymera_MicInit(const kymera_mic_config_t* mic_config);

/*@}*/

#endif /* KYMERA_SETUP_H_ */
